package com.example.controller;

import com.example.entity.Subject;
import com.example.service.SubjectService;
import com.example.utils.Msg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author： wzz
 * @date： 2021-11-02 22:03
 */

@Slf4j
@RestController
public class SubjectController {
    @Resource
    SubjectService subjectService;

    @GetMapping("/back/subject/delete")
    public Msg deleteSub(Subject subject){
        System.out.println(subject);
        if(subjectService.SubjectDelete(subject)==0) return Msg.fail();
        return Msg.success();
    }

    @GetMapping("/back/subject/update")
    public Msg updateSub(Subject subject){
        System.out.println(subject);
        if(subjectService.SubjectUpdate(subject)==0) return Msg.fail();
        return Msg.success();
    }



}
